import 'package:flutter/material.dart';
import 'package:study_flutter/yzhg/YConstant.dart';

class ScrollableDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("滚动列表"),
      ),
      body: Wrap(
        //设置方向
        direction: Axis.horizontal,
        //设置控件的起点
        alignment: WrapAlignment.start,
        children: <Widget>[
          /*SingleChildScrollView 滚动*/
          Padding(
            padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
            child: MaterialButton(
              color: Colors.blue,
              onPressed: () {
                Navigator.pushNamed(context, YConstant.SINGLE_CHILD_SCROLL);
              },
              minWidth: double.infinity,
              height: 50.0,
              shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(25)),
              elevation: 2.0,
              highlightElevation: 8.0,
              disabledElevation: 0.0,
              child: Text(
                "SingleChildScrollView",
                style: TextStyle(fontSize: 14.0, color: Colors.white),
              ),
            ),
          ),
          Padding(
            padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
            child: MaterialButton(
              color: Colors.blue,
              onPressed: () {
                Navigator.pushNamed(context, YConstant.DEFAULT_LIST);
              },
              minWidth: double.infinity,
              height: 50.0,
              shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(25)),
              elevation: 2.0,
              highlightElevation: 8.0,
              disabledElevation: 0.0,
              child: Text(
                "defaultList",
                style: TextStyle(fontSize: 14.0, color: Colors.white),
              ),
            ),
          ),
          Padding(
            padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
            child: MaterialButton(
              color: Colors.blue,
              onPressed: () {
                Navigator.pushNamed(context, YConstant.LISTVIEW_BUILDER_DEMO);
              },
              minWidth: double.infinity,
              height: 50.0,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(25)),
              elevation: 2.0,
              highlightElevation: 8.0,
              disabledElevation: 0.0,
              child: Text(
                "ListViewBuilderDemo",
                style: TextStyle(fontSize: 14.0, color: Colors.white),
              ),
            ),
          )
        ],
      ),
    );
  }
}
